import { defHttp } from "@/utils/http";

// ERP 商品信息 VO
export interface ComInfoVO {
	goodsId: number; // 商品ID
	goodsName: string; // 商品名称
	goodsType: number; // 商品类型
	sqNumb: number; // 序号
	no5086: number; // 5086编码
	grpId: number; // 分组
}

// ERP 商品信息 API
export const ComInfoApi = {
	// 查询商品信息分页
	getComInfoPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/goods/page`, params });
	},

	// 查询商品信息详情
	getComInfo: async (id: number) => {
		return await defHttp.get({ url: `/whs/goods/get?id=` + id });
	},

	// 新增商品信息
	createComInfo: async (data: ComInfoVO) => {
		return await defHttp.post({ url: `/whs/goods/create`, data });
	},

	// 修改商品信息
	updateComInfo: async (data: ComInfoVO) => {
		return await defHttp.put({ url: `/whs/goods/update`, data });
	},

	// 删除商品信息
	deleteComInfo: async (id: number) => {
		return await defHttp.delete({ url: `/whs/goods/delete?id=` + id });
	},

	// 导出商品信息 Excel
	exportComInfo: async (params: any) => {
		return await defHttp.download({ url: `/whs/goods/export-excel`, params });
	}
};
